import service from '@/utils/request'

// @Tags Constitution
// @Summary 创建体质
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Constitution true "创建体质"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /constitution/createConstitution [post]
export const createConstitution = (data) => {
  return service({
    url: '/constitution/createConstitution',
    method: 'post',
    data
  })
}

// @Tags Constitution
// @Summary 删除体质
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Constitution true "删除体质"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /constitution/deleteConstitution [delete]
export const deleteConstitution = (data) => {
  return service({
    url: '/constitution/deleteConstitution',
    method: 'delete',
    data
  })
}

// @Tags Constitution
// @Summary 批量删除体质
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除体质"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /constitution/deleteConstitutionByIds [delete]
export const deleteConstitutionByIds = (data) => {
  return service({
    url: '/constitution/deleteConstitutionByIds',
    method: 'delete',
    data
  })
}

// @Tags Constitution
// @Summary 更新体质
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Constitution true "更新体质"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /constitution/updateConstitution [put]
export const updateConstitution = (data) => {
  return service({
    url: '/constitution/updateConstitution',
    method: 'put',
    data
  })
}

// @Tags Constitution
// @Summary 用id查询体质
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.Constitution true "用id查询体质"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /constitution/findConstitution [get]
export const findConstitution = (params) => {
  return service({
    url: '/constitution/findConstitution',
    method: 'get',
    params
  })
}

// @Tags Constitution
// @Summary 分页获取体质列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取体质列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /constitution/getConstitutionList [get]
export const getConstitutionList = (params) => {
  return service({
    url: '/constitution/getConstitutionList',
    method: 'get',
    params
  })
}

export const setConstitutionArticle = (data) => {
  return service({
    url: '/constitution/setConstitutionArticle',
    method: 'post',
    data
  })
}


export const getConstitutionArticle = (params) => {
  return service({
    url: '/constitution/getConstitutionArticle',
    method: 'get',
    params
  })
}
